<%@include file="startUpIncludes.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
            View
        </title>
    </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="modal-win-bg">
        <div class="modal-win-box">
            <div class="modal-win-hd">
                <span class="modal-win-title"></span>
                <span class="modal-win-close">x</span>
            </div>
            <div class="modal-win-content"></div>
            <a class="form-btn modal-win-ok">OK</a>
        </div>
    </div>
    <div class="wrap">
	<div class="fitBG">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="views" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3>View</h3>
                <div class="content-block">
                    <h4>${view.name}</h4>
                    <c:set var="counter" value="0" />
	              		<c:forEach items="${viewLeads}" var="viewLead">
							<c:if test="${ not empty viewLead }">
								<c:set var="counter" value="${counter + 1}"></c:set>
							</c:if>
						</c:forEach>
                    <label>Count: <span>${counter}</span></label>
                    <div class="scroll-table">
                    <table class="recent-leads">
                        <thead>
                            <tr>
                			  <c:forEach items="${ fields }" var="field">
                                <th>${ field }</th>
                              </c:forEach>
                            </tr>
                        </thead>
                        <tbody>
                			<c:forEach items="${viewLeads}" var="viewLead">
                              <tr class="even">
	               			<c:forEach items="${viewLead}" var="item">
									<td><c:if test="${ not empty item }">${item}</c:if></td>
	                			</c:forEach>
                              </tr>
							</c:forEach>
                        </tbody>
                    </table>
                    </div>
                </div>
                </div>
            </div>
        </div>
        
    <%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>